import { defHttp } from '/@/utils/http/axios';
import setting from '/@/settings/projectSetting';

const Api = {
  message_oaListInbox: `${setting.interfacePrefix}/message_oa/listInbox`, // 内部邮件收件箱列表
  message_oaSendMsg: `${setting.interfacePrefix}/message_oa/sendMsg`, // 发送
  message_oaSaveDraft: `${setting.interfacePrefix}/message_oa/saveDraft`, // 保存草稿
  message_oaListCycle: `${setting.interfacePrefix}/message_oa/listCycle`, // 垃圾箱
  message_oaListOutbox: `${setting.interfacePrefix}/message_oa/listOutbox`, // 发件箱
  message_oaListDraft: `${setting.interfacePrefix}/message_oa/listDraft`, // 草稿箱
  message_oaShow: `${setting.interfacePrefix}/message_oa/show`, // 查看内部邮件
  message_oaTransmit: `${setting.interfacePrefix}/message_oa/transmit`, // 发送内部邮件草稿或转发内部邮件
  message_oaEditDraftPage: `${setting.interfacePrefix}/message_oa/editDraftPage`, // 编辑内部邮件草稿页面
  message_oaUpdateDraft: `${setting.interfacePrefix}/message_oa/updateDraft`, // 保存内部邮件草稿
  message_oaReply: `${setting.interfacePrefix}/message_oa/reply`, // 回复接口
  message_oaListChat: `${setting.interfacePrefix}/message_oa/listChat`, // 会话list展示接口
  message_oaDelToDustbin: `${setting.interfacePrefix}/message_oa/delToDustbin`, // 在回收站中删除
  message_oaDelChat: `${setting.interfacePrefix}/message_oa/delChat`, // 删除会话
  message_oaDel: `${setting.interfacePrefix}/message_oa/del`, // 彻底删除
  message_oaSetReaded: `${setting.interfacePrefix}/message_oa/setReaded`, // 设置已读
  message_oaSendReceipt: `${setting.interfacePrefix}/message_oa/sendReceipt`, // 设置已读
  message_oaRecall: `${setting.interfacePrefix}/message_oa/recall`, // 撤回
  message_oaRestore: `${setting.interfacePrefix}/message_oa/restore`, // 从垃圾箱中恢复
  message_oaGetAgentInfo: `${setting.interfacePrefix}/message_oa/getAgentInfo`, // 获取邮箱代理的部门信息
  message_oaSetAgent: `${setting.interfacePrefix}/message_oa/setAgent`, // 设置邮箱代理的部门信息
  message_oaCancelAgent: `${setting.interfacePrefix}/message_oa/cancelAgent`, // 取消邮箱代理的部门信息
  message_oaDelMsgBySenderDustbin: `${setting.interfacePrefix}/message_oa/delMsgBySenderDustbin`, // 删除信息通过发送人的垃圾箱
  message_oaDelAttachment: `${setting.interfacePrefix}/message_oa/delAttachment`, // 删除附件
};
export const getMessage_oaDelAttachment = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaDelAttachment,
    params,
  });
export const getMessage_oaDelMsgBySenderDustbin = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaDelMsgBySenderDustbin,
    params,
  });
export const getMessage_oaCancelAgent = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaCancelAgent,
    params,
  });
export const getMessage_oaSetAgent = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaSetAgent,
    params,
  });
export const getMessage_oaGetAgentInfo = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaGetAgentInfo,
    params,
  });
export const getMessage_oaSetReaded = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaSetReaded,
    params,
  });
export const getMessage_oaDelToDustbin = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaDelToDustbin,
    params,
  });
export const getMessage_oaDelChat = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaDelChat,
    params,
  });
export const getMessage_oaDel = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaDel,
    params,
  });
export const getMessage_oaListChat = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaListChat,
    params,
  });
export const getMessage_oaReply = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaReply,
    params,
    headers: {
      'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryVD0qp8RY7NId5ucK',
    },
  });
export const getMessage_oaUpdateDraft = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaUpdateDraft,
    params,
    headers: {
      'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryVD0qp8RY7NId5ucK',
    },
  });
export const getMessage_oaEditDraftPage = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaEditDraftPage,
    params,
  });
export const getMessage_oaTransmit = (params?: any, id?: any) =>
  defHttp.post<any>({
    url: Api.message_oaTransmit + `?id=${id}`,
    params,
    headers: {
      'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryVD0qp8RY7NId5ucK',
    },
  });
export const getMessage_oaShow = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaShow,
    params,
  });

export const getMessage_oaListDraft = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaListDraft,
    params,
  });
export const getMessage_oaListOutbox = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaListOutbox,
    params,
  });
export const getMessage_oaListCycle = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaListCycle,
    params,
  });
export const getMessage_oaSaveDraft = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaSaveDraft,
    params,
    headers: {
      'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryVD0qp8RY7NId5ucK',
    },
  });
export const getMessage_oaSendMsg = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaSendMsg,
    params,
    headers: {
      'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundaryVD0qp8RY7NId5ucK',
    },
  });
export const getMessage_oaListInbox = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaListInbox,
    params,
  });
export const getMessage_oaSendReceipt = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaSendReceipt,
    params,
  });

export const getMessage_oaRecall = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaRecall,
    params,
  });

export const getMessage_oaRestore = (params?: any) =>
  defHttp.post<any>({
    url: Api.message_oaRestore,
    params,
  });
